<?php


namespace app\api\model;


class Rush extends BaseModel {

    public function getRush($where,$field='*'){
        return self::field($field)->with('Goods')->where($where)->find();
    }

    public function getRushList($where,$page,$pagesize=''){
        $pagesize = $pagesize ? $pagesize : $this->pagesize;
        $start = ( $page - 1 ) * $pagesize;
        return self::with('Goods')->where($where)->limit($start,$pagesize)->select();
    }

    public function Goods(){
        return $this->hasOne('goods','id','goodsid')->field('id,name,describe,num,images,pprice,mprice');
    }


}